package com.ms.oschina.fragment;

import android.os.Bundle;

import com.ms.oschina.R;
import com.ms.oschina.adapter.ViewPagerFragmentAdapter;
import com.ms.oschina.base.BasePagerSlidingTabFragment;
import com.ms.oschina.bean.Constants;
import com.ms.oschina.bean.FriendsList;
import com.ms.oschina.util.UiUtils;

public class MessageFragment extends BasePagerSlidingTabFragment {

	private Class[] fragments = new Class[] { AboutMeFragment.class,
			AboutMeFragment.class, FavoriteInfoFragment.class,
			FollowInfoFragment.class, FollowInfoFragment.class };

	public static final int ATME = 0;
	public static final int COMMENT = 1;
	public static final int CODE = 2;
	public static final int BLOG = 3;
	public static final int LIKEME = 4;

	private int[] mark = new int[] { ATME, COMMENT, CODE,
			FriendsList.TYPE_FANS, LIKEME };


	@Override
	public void addTab(ViewPagerFragmentAdapter adapter) {
		String[] titles = UiUtils.getStringArray(R.array.mymes_viewpage_arrays);

		for (int i = 0; i < titles.length; i++) {
			Bundle args = new Bundle();
			args.putInt(Constants.ARGS, mark[i]);
			adapter.addTab(titles[i], fragments[i], args);
		}
	}

	@Override
	public int offscreenPageLimit() {
		return 4;
	}
}
